package com.tnovoselec.android.travelassistant.activity;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.actionbarsherlock.view.MenuItem;
import com.tnovoselec.android.travelassistant.R;
import com.tnovoselec.android.travelassistant.fragment.GasPricesFragment;

import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

public class GasPricesActivity extends SherlockFragmentActivity{
	
	@Override
	protected void onCreate(Bundle icicle) {
		super.onCreate(icicle);
		
		if (icicle == null){
			GasPricesFragment gpf = new GasPricesFragment();
			getSupportFragmentManager().beginTransaction().add(android.R.id.content, gpf).commit();
		}
		
	}
	@Override
	protected void onStart() {
		super.onStart();
		ActionBar bar = getSupportActionBar();
		if (bar != null) {
			bar.setDisplayHomeAsUpEnabled(true);
		}
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		if (item.getItemId() == android.R.id.home) {
			finish();
			return true;
		}
		return super.onOptionsItemSelected(item);
	}
	
	@Override
	protected void onPause() {
		overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
		super.onPause();
	}

}
